package cn.sfrog.project.biz.applet.controller;

import cn.sfrog.common.constant.Constants;
import cn.sfrog.common.core.controller.BaseController;
import cn.sfrog.common.core.domain.ApiAjaxResult;
import cn.sfrog.common.core.redis.RedisCache;
import cn.sfrog.project.biz.applet.entity.AccompanyVisitorEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author chenl
 * @Date 2024-01-21 10:14
 * @title AppletOrderController
 * @description
 **/
@Slf4j
@RestController
@RequestMapping("/api/Order")
@Api(value = "/api/Order", tags = "小程序相关")
public class AppletOrderController extends BaseController{
    @Autowired
    RedisCache redisCache;
    @ApiOperation(value = "获取小程序下单签名",httpMethod = "GET")
    @GetMapping("/appletPaySign/{orderNumber}")
    public ApiAjaxResult getVisitorList(@PathVariable String orderNumber){
        String key = Constants.APPLET_WX_PAY_MAP + orderNumber;
        Map<String, Object> cacheMap = redisCache.getCacheMap(key);
        log.info("获取小程序下单签名：{}",cacheMap);
        return ApiAjaxResult.success(cacheMap);
    }
}
